package ar.edu.unlu.sistemas.ws.business;

import java.io.ByteArrayInputStream;
import java.io.ObjectInputStream;
import org.apache.xmlbeans.impl.util.Base64;

public class Deserializer {
	
	public static ResourceDescriptionWS deserializeDescription(String serializedContent) {
		try {
			Base64.decode(serializedContent.getBytes());
			ByteArrayInputStream bais = new ByteArrayInputStream(org.apache.xmlbeans.impl.util.Base64.decode(serializedContent.getBytes()));
			ObjectInputStream ois = new ObjectInputStream(bais);
			ResourceDescriptionWS description = (ResourceDescriptionWS)ois.readObject();
			ois.close();
			return description;
		} catch (Exception e) {
			return null;
		}
	}

}
